@use "sass:map";
@import "../node_modules/bootstrap/scss/bootstrap";
@import "./pytch-variables.scss";

$project-display-side-margin: 3rem;

.ProjectList {
  overflow-y: auto;
  flex-shrink: 1;
  flex-grow: 1;
  h1 {
    margin: 1.5rem 0px;
    text-align: center;
  }

  .loading-placeholder {
    display: flex;
    flex-direction: row;
    justify-content: center;

    p {
      background-color: #cfc;
      padding: 2rem;
      border-radius: 8px;
      font-size: 1.25rem;
    }
  }

  > ul {
    margin: 0px #{$project-display-side-margin};
    padding: 0px;
    list-style: none;
    li {
      margin: auto;
      max-width: 52rem;

      .project-card-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
      }

      .project-description {
        margin: 0px;
        padding: 0px;
        font-size: 1.125rem;
        flex-grow: 1;

        p {
          margin: 0px;
        }

        .project-name {
          font-weight: bold;
        }

        .project-mtime {
          color: #444;
          font-size: 1rem;
        }

        .project-summary {
          margin-top: 0.5rem;
          font-style: italic;
        }
      }

      :hover {
        text-decoration: none;
      }

      .ProjectCard .selection-check {
        margin-right: 1rem;
        visibility: hidden;
        font-size: 1.5rem;

        &.selected {
          color: map.get($theme-colors, "primary");
          visibility: visible;
        }
      }
      .ProjectCard:hover .selection-check {
        visibility: visible;
        color: #aaa;

        &.selected,
        &.selected:hover {
          color: map.get($theme-colors, "primary");
        }
        &:hover {
          color: mix(map.get($theme-colors, "primary"), #aaa, 50%);
        }
      }
      .ProjectCard:hover {
        border: 1px solid black;
      }
      div:after {
        content: "";
        clear: both;
        display: table;
      }
    }
  }

  .buttons {
    width: 32rem;
    padding: 0.75rem 0px;
    margin: 1.5rem auto;
    border-radius: 8px;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    &.some-selected {
      background-color: #eee;

      .intro {
        margin: 0px 1.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        button {
          margin-left: 0px;
          margin-right: 0.5rem;
        }
        span {
          font-size: 1.25rem;
          font-weight: bold;
          width: 2rem;
          margin: 0px 4rem 0px 0px;
        }
      }
    }

    text-align: center;

    button {
      margin: 0px 1rem;
    }
  }
  .dropdown-wrapper {
    float: right;
    margin: 0.5rem;
  }
}

.ProjectList ul li p {
  display: flex;
  flex-direction: row;
}

.ProjectList ul.some-selected .dropdown-wrapper {
  visibility: hidden;
}

.ProjectList:focus {
  outline: none;
}

.ProjectCard {
  cursor: pointer;
}

.CopyLinkDiv {
  border: 1px dashed $pytch-colour-main-blue;
  padding: 15px 15px;
  margin-bottom: 20px;
  border-radius: 10px;
  display: inline-block;

  button {
    margin-right: 20px;
  }
}

.ProjectList.from-specimen {
  > h2 {
    font-size: 1.5rem;
    margin: 2rem;
    text-align: center;
  }
  > h3 {
    width: 52rem;
    font-size: 1.25rem;
    margin: 2rem auto;
    text-align: left;
  }
}
